#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :move.py
# @Time      :2021/3/7 22:41
# @Author    :Letquit
"""
文件说明：

"""


def h(n):
    return 2 ** n - 1


def move(n, a, b, c):   # 1 n=3 a=A b=B c=C <-- 2 n=2 a=A b=C c=B <-- 3 n=1 a=A b=B c=C # n=2 a=A b=C c=B
    if n == 1:
        print(a, '-->', c)  # a-c # 3 over # a-b # 2 over # b-a # 1 over # a-c # 2 over
        # print("n =", n, "; a =", a, "; b =", b, "; c =", c)
    else:
        move(n-1, a, c, b)  # 1 n=2 a=A b=C c=B <-- 2 n=1 a=A b=B c=C   # 1 n=3 a=A b=C c=B over # 1 n=1 a=B b=C c=A
        # print("n =", n, "; a =", a, "; b =", b, "; c =", c)  # 1 n=3 a=A b=C c=B
        print(a, '-->', c)  # a-b# 2 n=2 a=A b=C c=B # b-c # n=2 a=B b=A c=C
        move(n-1, b, a, c)  # 2 n=2 a=C b=A c=B # 1 n=2 a=B b=A c=C # 2 n=1 a=A b=B c=C
        # print("n =", n, "; a =", a, "; b =", b, "; c =", c)


# 期待输出:
# A --> C
# A --> B
# C --> B
# A --> C
# B --> A
# B --> C
# A --> C
move(3, 'A', 'B', 'C')
if __name__ == "__main__":
    run_code = 0
